home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / linux / howto.networking.part2 < prev    next >
Encoding:
Text File  |  1995-07-25  |  50.9 KB  |  1,515 lines

  1. Subject: Linux NET-2 HOWTO (part 2/3)
  2. Newsgroups: comp.os.linux.announce,comp.os.linux.help,comp.os.linux.admin,news.answers,comp.answers
  3. From: terryd@extro.ucc.su.oz.au (Terry Dawson)
  4. Date: Fri, 18 Nov 1994 17:11:50 GMT
  5.  
  6. Archive-name: linux/howto/networking/part2
  7. Last-modified: 18 Nov 94
  8.  
  9.  
  10. ---This is part 2/3---
  11.  
  12.  
  13.  
  14.  
  15.   The above example assumes you are calling a dynamic slip server, if
  16.   you are calling a static slip server, then remove the following two
  17.   lines:
  18.  
  19.  
  20.  
  21.  
  22.  
  23.   get $local remote 10             ## Assumes the server sends your IP..
  24.   if $errlvl != 0 goto error       ## address as soon as you enter slip.
  25.  
  26.  
  27.  
  28.  
  29.   When dip is given the get $local command it searches the incoming text
  30.   from the remote end for a string that looks like an IP address, ie
  31.   strings numbers seperated by `.' characters. This modification was put
  32.   in place specifically for dynamic slip servers, so that the process of
  33.   reading the IP address granted by the server could be automated.
  34.  
  35.   The example above will automaticaly create a default route via your
  36.   slip link, if this is not what you want, you might have an ethernet
  37.   connection that should be your default route, then remove the default
  38.   command from the script.  After this script has finished running, if
  39.   you do an ifconfig command, you will see that you have a device sl0.
  40.   This is your slip device.  Should you need to, you can modify its
  41.   configuration manually, after the dip command has finished, using the
  42.   ifconfig and route commands.
  43.  
  44.   Please note that dip allows you to select a number of different
  45.   protocols to use with the mode command, the most common example is
  46.   cslip for slip with compression. Please note that both ends of the
  47.   link must agree, so you should ensure that whatever you select agrees
  48.   with what your server is set to.
  49.  
  50.   The above example is fairly robust and should cope with most errors.
  51.   Please refer to the dip man page for more information. Naturally you
  52.   could, for example, code the script to do such things as redial the
  53.   server if it doesn't get a connection within a prescribed period of
  54.   time, or even try a series of servers if you have access to more than
  55.   one.
  56.  
  57.  
  58.   8.6.7.  Permament slip connection using a leased line and slattach.
  59.  
  60.   If you have a cable between two machines, or are fortunate enough to
  61.   have a leased line, or some other permanent serial connection between
  62.   your machine and another, then you don't need to go to all the trouble
  63.   of using dip to set up your serial link. slattach is a very simple to
  64.   use utility that will allow you just enough functionality to configure
  65.   your connection.
  66.  
  67.   Since your connection will be a permanent one, you will want to add
  68.   some commands to your rc.inet1 file. In essence all you need to do for
  69.   a permament connection is ensure that you configure the serial device
  70.   to the correct speed and switch the serial device into slip mode.
  71.   slattach allows you to do this with one command. Add the following to
  72.   your rc.inet1 file:
  73.  
  74.  
  75.  
  76.        #
  77.        # Attach a leased line static slip connection
  78.        #
  79.        #  configure /dev/cua0 for 19.2kbps and cslip
  80.        /sbin/slattach -p cslip -s 19200 /dev/cua0 &
  81.        /sbin/ifconfig sl0 IPA.IPA.IPA.IPA pointopoint IPR.IPR.IPR.IPR up
  82.        #
  83.        # End static slip.
  84.  
  85.  
  86.  
  87.  
  88.  
  89.   Where:
  90.  
  91.      IPA.IPA.IPA.IPA
  92.         represents your IP address.
  93.  
  94.      IPR.IPR.IPR.IPR
  95.         represents the IP address of the remote end.
  96.  
  97.   slattach allocated the first unallocated slip device to the serial
  98.   device specified. slattach starts with sl0. Therefore the first
  99.   slattach command attaches slip device sl0 to the serial device
  100.   specified, and sl1 the next time, etc.
  101.  
  102.   slattach allows you to configure a number of different protocols with
  103.   the -p argument. In your case you will use either slip or cslip
  104.   depending on whether you want to use compression or not.  Note: both
  105.   ends must agree on whether you want compression or not.
  106.  
  107.  
  108.   8.7.  Configuring a PLIP device. (optional)
  109.  
  110.   plip (Parallel Line IP), is like slip, in that it is used for
  111.   providing a point to point network connection between two machines,
  112.   except that it is designed to use the parallel printer ports on your
  113.   machine instead of the serial ports. Because it is possible to
  114.   transfer more than one bit at a time with a parallel port, it is
  115.   possible to attain higher speeds with the plip interface than with a
  116.   standard serial device. In addition, even the simplest of parallel
  117.   ports, printer ports, can be used, in lieu of you having to purchase
  118.   comparitively expensive 16550AFN UART's for your serial ports.
  119.  
  120.   Please note that some laptops use chipsets that will not work with
  121.   PLIP because they do not allow some combinations of signals that PLIP
  122.   relies on, that printers don't use.
  123.  
  124.   The Linux plip interface is compatible with the Crywyr Packet Driver
  125.   PLIP, and this will mean that you can connect your Linux machine to a
  126.   DOS machine running any other sort of tcp/ip software via plip.
  127.  
  128.   When compiling the kernel, there is only one file that might need to
  129.   be looked at to configure plip. That file is
  130.   /usr/src/linux/driver/net/CONFIG, and it contains plip timers in mS.
  131.   The defaults are probably ok in most cases. You will probably need to
  132.   increase them if you have an especially slow computer, in which case
  133.   the timers to increase are actually on the other computer.
  134.  
  135.   To configure a plip interface, you will need to add the following
  136.   lines to your rc.inet1 file:
  137.  
  138.  
  139.  
  140.        #
  141.        # Attach a PLIP interface
  142.        #
  143.        #  configure first parallel port as a plip device
  144.        /sbin/ifconfig plip0 IPA.IPA.IPA.IPA pointopoint IPR.IPR.IPR.IPR up
  145.        #
  146.        # End plip
  147.  
  148.  
  149.  
  150.  
  151.   Where:
  152.  
  153.      IPA.IPA.IPA.IPA
  154.         represents your IP address.
  155.      IPR.IPR.IPR.IPR
  156.         represents the IP address of the remote machine.
  157.  
  158.   The pointopoint parameter has the same meaning as for slip, in that it
  159.   specifies the address of the machine at the other end of the link.
  160.  
  161.   In almost all respects you can treat a plip interface as though it
  162.   were a slip interface, except that neither dip nor slattach need be,
  163.   nor can be, used.
  164.  
  165.  
  166.   8.7.1.  PLIP cabling diagram.
  167.  
  168.   plip has been designed to use cables with the same pinout as those
  169.   commonly used by the better known of the MS-DOS based pc-pc file
  170.   transfer programs.
  171.  
  172.  
  173.   The pinout diagram (taken from /usr/src/linux/drivers/net/plip.c)
  174.   looks as follows:
  175.  
  176.  
  177.  
  178.        Pin Name    Connect pin - pin
  179.        ---------   -------------------------------
  180.        GROUND      25 - 25
  181.        D0->ERROR   2 - 15
  182.        ERROR->D0   15 - 2
  183.        D1->SLCT    3 - 13
  184.        SLCT->D1    13 - 3
  185.        D2->PAPOUT  4 - 12
  186.        PAPOUT->D2  12 - 4
  187.        D3->ACK     5 - 10
  188.        ACK->D3     10 - 5
  189.        D4->BUSY    6 - 11
  190.        BUSY->D4    11 - 6
  191.        D5          7*
  192.        D6          8*
  193.        D7          9*
  194.        STROBE      1*
  195.        FEED        14*
  196.        INIT        16*
  197.        SLCTIN      17*
  198.  
  199.  
  200.  
  201.  
  202.   Notes: Do not connect the pins marked with an asterisk `*'.  Extra
  203.   grounds are 18,19,20,21,22,23, and 24.
  204.  
  205.   If the cable you are using has a metallic shield, it should be
  206.   connected to the metallic DB-25 shell at one end only.
  207.  
  208.   Warning: A miswired PLIP cable can destroy your controller card. Be
  209.   very careful, and double check every connection to ensure you don't
  210.   cause yourself any unnecessary work or heartache.
  211.  
  212.   While you may be able to run PLIP cables for long distances, you
  213.   should avoid it if you can. The specifications for the cable allow for
  214.   a cable length of about 1 metre or so. Please be very careful when
  215.   running long plip cables as sources of strong electromagnetic fields
  216.   such as lightning, power lines, and radio transmitters can interfere
  217.   with and sometimes even damage your controller. If you really want to
  218.   connect two of your computers over a large distance you really should
  219.   be looking at obtaining a pair of thin-net ethernet cards and running
  220.   some coaxial cable.
  221.   9.  Routing. (mandatory)
  222.  
  223.   After you have configured all of your network devices you need to
  224.   think about how your machine is going to route IP datagrams. If you
  225.   have only one network device configured then your choice is easy, as
  226.   all datagrams for any machine other than yours must go via that
  227.   interface. If you have more than one network interface then your
  228.   choice is a little more complicated. You might have both an ethernet
  229.   device and slip connection to your machine at home. In this situation
  230.   you must direct all datagrams for your machine at home via your slip
  231.   interface, and all else via the ethernet device. Routing is actually a
  232.   very simple mechanism, but don't worry if you find it slightly
  233.   difficult to understand at first; everybody does.
  234.  
  235.   You can display the contents of your routing table by using the route
  236.   command without any options.
  237.  
  238.   There are four commonly used routing mechanisms for unix network
  239.   configurations.  I'll briefly discuss each in turn.
  240.  
  241.  
  242.   9.1.  Static/Manual Routes.
  243.  
  244.   Static routing, as its name implies, is `hard coded' routing, that is,
  245.   it will not change if your network suffers some failure, or if an
  246.   alternate route becomes available. Static routes are often used in
  247.   cases where you have a very simple network with no alternate routes
  248.   available to a destination host, that is, there is only one possible
  249.   network path to a destination host, or where you want to route a
  250.   particular way to a host regardless of network changes.
  251.  
  252.   In Linux there is a special use for manual routes, and that is for
  253.   adding a route to a slip or plip host where you have used the ifconfig
  254.   pointopoint parameter. If you have a slip/plip link, and have the
  255.   pointopoint parameter specifying the address of the remote host, then
  256.   you should add a static route to that address so that the ip routing
  257.   software knows how to route datagrams to that address. The route
  258.   command you would use for the slip/plip link via leased line example
  259.   presented earlier would be:
  260.  
  261.  
  262.  
  263.        #/sbin/route add IPR.IPR.IPR.IPR
  264.  
  265.  
  266.  
  267.  
  268.   Where:
  269.  
  270.      IPR.IPR.IPR.IPR
  271.         represents the IP address of the remote end.
  272.  
  273.  
  274.   9.2.  Default Route.
  275.  
  276.   The default route mechanism is probably the most common and most
  277.   useful to most end-user workstations and hosts on most networks. The
  278.   default route is a special static route that matches every destination
  279.   address, so that if there is no more specific route for a datagram to
  280.   be sent to, then the default route will be used.
  281.  
  282.   If you have a configuration where you have only a single ethernet
  283.   interface, or a single slip interface device defined then you should
  284.   point your default route via it. In the case of an ethernet interface,
  285.   the Linux kernel knows where to send datagrams for any host on your
  286.   network. It works this out using the network address and the network
  287.   mask as discussed earlier. This means that the only datagrams the
  288.   kernel won't know how to properly route will be those for people not
  289.   on your network. To make this work you would normally have your
  290.   default route point to your router address, as it is your means of
  291.   getting outside of your local network. If you are using a slip
  292.   connection, then your slip server will be acting as your router, so
  293.   your default route will be via your slip server.
  294.  
  295.   To configure your default route, add the following to your rc.inet1
  296.   after all of your network device configurations:
  297.  
  298.  
  299.  
  300.        #
  301.        # Add a default route.
  302.        #
  303.        /sbin/route add default gw RGA.RGA.RGA.RGA
  304.        #
  305.  
  306.  
  307.  
  308.  
  309.   Where:
  310.  
  311.      RGA.RGA.RGA.RGA
  312.         represents your Router/Gateway Address.
  313.  
  314.  
  315.   9.3.  Proxy ARP.
  316.  
  317.   This method is ugly, hazard prone and should be used with extreme
  318.   care, some of you will want to use it anyway.
  319.  
  320.   Those with the greatest need for proxy arp will be those of you who
  321.   are configuring your Linux machine as a slip dial-in server. For those
  322.   of you who will be using PPP, the PPP daemon simplifies and automates
  323.   this task, making it a lot safer to use.
  324.  
  325.   Normally when a host on your ethernet network wants to talk to you, it
  326.   knows your IP address, but doesn't know what hardware (ethernet)
  327.   address to send datagrams to. The ARP mechanism is there specifically
  328.   to provide that mapping function between network address and hardware
  329.   address.
  330.  
  331.   If you want to use your machine as a server for other machines, you
  332.   must get your machine to answer ARP requests for their IP addresses on
  333.   their behalf, as they will not be physically connected to the ethernet
  334.   network. Lets say that you have been assigned a number of IP addresses
  335.   on your local network that you will be offering to dial-in slip users.
  336.   Lets say those addresses are: 128.253.154.120-124, and that you have
  337.   an ethernet card with a hardware address of 00:00:C0:AD:37:1C. (You
  338.   can find the hardware address of your ethernet card by using the
  339.   ifconfig command with no options). To instruct your Linux server to
  340.   answer arp requests by proxy for these addresses you would need to add
  341.   the following commands to the end of your rc.inet1 file:
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.   #
  354.   # Proxy ARP for those dialin users who will be using this
  355.   #           machine as a server:
  356.   #
  357.   /sbin/arp -s 128.263.154.120 00:00:C0:AD:37:1C pub
  358.   /sbin/arp -s 128.263.154.121 00:00:C0:AD:37:1C pub
  359.   /sbin/arp -s 128.263.154.122 00:00:C0:AD:37:1C pub
  360.   /sbin/arp -s 128.263.154.123 00:00:C0:AD:37:1C pub
  361.   /sbin/arp -s 128.263.154.124 00:00:C0:AD:37:1C pub
  362.   #
  363.   # End proxy arps.
  364.  
  365.  
  366.  
  367.  
  368.   The pub argument stands for `publish'. It is this argument that
  369.   instructs your machine to answer requests for these addresses, even
  370.   though they are not for your machine. When it answers it will supply
  371.   the hardware address specified, which is of course its own hardware
  372.   address.
  373.  
  374.   Naturally you will need to ensure that you have routes configured in
  375.   your linux server that point these addresses to the slip device on
  376.   which they will be connecting.
  377.  
  378.   If you are using PPP, you don't need to worry about manually messing
  379.   with the arp table, as the pppd will manage those entries for you if
  380.   you use the proxyarp parameter, and as long as the IP addresses of the
  381.   remote machine and the server machine are in the same network. You
  382.   will need to supply the netmask of the network on the server's pppd
  383.   command line.
  384.  
  385.  
  386.   9.4.  gated - the routing daemon.
  387.  
  388.   gated could be used in place of proxy arp in some cases, and would
  389.   certainly be much cleaner, but its primary use is if you want your
  390.   linux machine to act as an intelligent ip router for your network.
  391.   gated provides support for a number of routing protocols. Among these
  392.   are RIP, BGP, EGP, HELLO, and OSPF. The most commonly used in small
  393.   networks being rip. rip stands for `Routing Information Protocol'. If
  394.   you run gated, configured for rip, your linux machine will
  395.   periodically broadcast a copy of its routing table to your network in
  396.   a special format. In this way, all of the other machines on your
  397.   network will know what addresses are accessible via your machine.
  398.  
  399.   gated can be used to replace proxy arp when all hosts on your network
  400.   run either gated or routed. If you have a network where you use a
  401.   mixture of manual and dynamic routes, you should mark any manual
  402.   routes as `passive' to ensure that they aren't destroyed by gated
  403.   because it hasn't received an update for them.
  404.  
  405.   gated would normally be started from your rc.inet2 which is covered in
  406.   the next section. You might already see a daemon called routed
  407.   running. gated is superior to routed in that it is more flexible and
  408.   more functional. So you should use gated and not routed.
  409.  
  410.  
  411.   9.4.1.  Obtaining gated
  412.  
  413.   Gated is available from:
  414.  
  415.   sunsite.unc.edu
  416.  
  417.  
  418.  
  419.   /pub/Linux/system/Network/daemons/gated.linux.bin.tgz
  420.                                    /gated.linux.man.tgz
  421.                                    /gated.linux.tgz
  422.  
  423.  
  424.  
  425.  
  426.   gated.linux.tgz is the source, so you probably won't need it unless
  427.   you wish to recompile the binaries for some reason.
  428.  
  429.  
  430.   9.4.2.  Installing gated
  431.  
  432.   The gated binary distribution comprises three programs and two sample
  433.   configuration files.
  434.  
  435.   The programs are:
  436.  
  437.  
  438.      gated
  439.         the actual gated daemon.
  440.  
  441.      gdc
  442.         the operational user interface for gated. gdc is for controlling
  443.         the gated daemon, stopping and starting it, obtaining its status
  444.         and the like.
  445.  
  446.      ripquery
  447.         a diagnostic tool to query the known routes of a gateway using
  448.         either a `rip query' or a `rip poll'.
  449.  
  450.   The configuration files are:
  451.  
  452.  
  453.      gated.conf
  454.         this is the actual configuration file for the gated daemon. It
  455.         allows you to specify how gated will behave when it is running.
  456.         You can enable and disable any of the routing protocols, and
  457.         control the behaviour of those routing protocols running.
  458.  
  459.      gated.version
  460.         a text file that describes the version number of the gated
  461.         daemon
  462.  
  463.   The gated binary distribution will not install the gated files in the
  464.   correct place for you. Fortunately there aren't very many, so its
  465.   fairly simple to do.
  466.  
  467.   To install the binaries try the following:
  468.  
  469.  
  470.  
  471.        # cd /tmp
  472.        # gzip -dc .../gated.linux.bin.tgz | tar xvf -
  473.        # install -m 500 bin/gated /usr/etc
  474.        # install -m 444 bin/gated.conf bin/gated.version /etc
  475.        # install -m 555 bin/ripquery bin/gdc /sbin
  476.        # rm -rf /tmp/bin
  477.  
  478.  
  479.  
  480.  
  481.   I keep the networking daemons in /usr/etc, if yours are somewhere else
  482.   then naturally you'll have to change the target directory. The sample
  483.   gated configuration file included configures gated to emulate the old
  484.   routed daemon.
  485.   To install the man files, try the following:
  486.  
  487.  
  488.  
  489.        # cd /tmp
  490.        # gzip -dc .../gated.linux.man.tgz | tar xvf -
  491.        # install -m 444 man/*.8 /usr/man/man8
  492.        # install -m 444 man/*.5 /usr/man/man5
  493.        # rm -rf /tmp/man
  494.  
  495.  
  496.  
  497.  
  498.   The man files contain concise and detailed information on the
  499.   configuration and use of gated. For information on configuring gated,
  500.   refer to the gated-config man page.
  501.  
  502.  
  503.   10.  Configuring the network daemons.
  504.  
  505.   As mentioned earlier, there are other files that you will need to
  506.   complete your network installation. These files concern higher level
  507.   configurations of the network software. Each of the important ones are
  508.   covered in the following sub-sections, but you will find there are
  509.   others that you will have to configure as you become more familiar
  510.   with the network suite.
  511.  
  512.  
  513.   10.1.  /etc/rc.d/rc.inet2 (the second half of rc.net)
  514.  
  515.   If you have been following this document you should at this stage have
  516.   built an rc file to configure each of your network devices with the
  517.   correct addresses, and set up whatever routing you will need for your
  518.   particular network configuration. You will now need to actually start
  519.   some of the higher level network software.
  520.  
  521.   Now would be a really good time to read Olaf's Network Administrators
  522.   Guide, as it really should be considered the definitive document for
  523.   this stage of the configuration process. It will help you decide what
  524.   to include in this file, and more importantly perhaps, what not to
  525.   include in this file. For the security conscious it is a fair
  526.   statement to say that the more network services you have running, the
  527.   more likely the chance of your system having a security hole: Run only
  528.   what you need.
  529.  
  530.   There are some very important daemons (system processes that run in
  531.   the background) that you will need to know a little about. The man
  532.   pages will tell you more, but they are:
  533.  
  534.  
  535.   10.1.1.  inetd.
  536.  
  537.   inetd is a program that sits in the background and manages internet
  538.   connection requests and the like. It is smart enough that you don't
  539.   need to leave a whole bunch of servers running when there is nothing
  540.   connected to them.  When it sees an incoming request for a particular
  541.   service, eg telnet, or ftp, it will check the /etc/services file, find
  542.   what server program needs to be run to manage the request, start it,
  543.   and hand the connection over to it. Imagine it as a master server for
  544.   your internet servers. It also has a few simple standard services
  545.   inbuilt. These are echo, discard and generate services used for
  546.   various types of network testing.
  547.  
  548.  
  549.  
  550.  
  551.   10.1.2.  syslogd.
  552.  
  553.   syslogd is a daemon that handles all system logging. It accepts
  554.   messages generated for it and will distribute them according to a set
  555.   of rules contained in /etc/syslogd.conf. For example, certain types of
  556.   messages you will want to send to the console, and also to a log file,
  557.   where others you will want only to log to a file. syslogd allows you
  558.   to specify what messages should go where.
  559.  
  560.  
  561.   10.2.  A sample rc.inet2 file.
  562.  
  563.   The following is a sample rc.inet2 file that Fred built. It starts a
  564.   large number of servers, so you might want to trim it down to just
  565.   those services that you actually want to run. To trim it down, simply
  566.   delete or comment out the stanzas (if to fi) that you don't need. All
  567.   each stanza does is test that the relevant module is a file, that it
  568.   exists, echoes a comment that you can see when you boot your machine,
  569.   and then executes the commands with the arguments supplied to ensure
  570.   that it runs happily in the background. For more detailed information
  571.   on each of the deamons, check either the Network Administrators Guide
  572.   or the relevant man pages.
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.   #! /bin/sh
  618.   #
  619.   # rc.inet2      This shell script boots up the entire INET system.
  620.   #               Note, that when this script is used to also fire
  621.   #               up any important remote NFS disks (like the /usr
  622.   #               distribution), care must be taken to actually
  623.   #               have all the needed binaries online _now_ ...
  624.   #
  625.   # Version:      @(#)/etc/rc.d/rc.inet2  2.18    05/27/93
  626.   #
  627.   # Author:       Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  628.   #
  629.  
  630.   # Constants.
  631.   NET="/usr/etc"
  632.   IN_SERV="lpd"
  633.   LPSPOOL="/var/spool/lpd"
  634.  
  635.   # At this point, we are ready to talk to The World...
  636.   echo -e "\nMounting remote file systems ..."
  637.   /bin/mount -t nfs -v            # This may be our /usr runtime!!!
  638.  
  639.   echo -e "\nStarting Network daemons ..."
  640.   # Start the SYSLOG daemon.  This has to be the first server.
  641.   # This is a MUST HAVE, so leave it in.
  642.   echo -n "INET: "
  643.   if [ -f ${NET}/syslogd ]
  644.   then
  645.           echo -n "syslogd "
  646.           ${NET}/syslogd
  647.   fi
  648.  
  649.   # Start the SUN RPC Portmapper.
  650.   if [ -f ${NET}/rpc.portmap ]
  651.   then
  652.           echo -n "portmap "
  653.           ${NET}/rpc.portmap
  654.   fi
  655.  
  656.   # Start the INET SuperServer
  657.   # This is a MUST HAVE, so leave it in.
  658.   if [ -f ${NET}/inetd ]
  659.   then
  660.           echo -n "inetd "
  661.           ${NET}/inetd
  662.   else
  663.           echo "no INETD found.  INET cancelled!"
  664.           exit 1
  665.   fi
  666.  
  667.   # Start the NAMED/BIND name server.
  668.   if [ ! -f ${NET}/named ]
  669.   then
  670.           echo -n "named "
  671.           ${NET}/named
  672.   fi
  673.  
  674.   # Start the ROUTEd server.
  675.   # NOTE: routed is now obselete. You should now use gated.
  676.   #if [ -f ${NET}/routed ]
  677.   #then
  678.   #        echo -n "routed "
  679.   #        ${NET}/routed -q #-g -s
  680.   #fi
  681.  
  682.   # Start the GATEd server.
  683.   if [ -f ${NET}/gated ]
  684.   then
  685.           echo -n "gated "
  686.           ${NET}/gated
  687.   fi
  688.  
  689.   # Start the RWHO server.
  690.   if [ -f ${NET}/rwhod ]
  691.   then
  692.           echo -n "rwhod "
  693.           ${NET}/rwhod -t -s
  694.   fi
  695.  
  696.   # Start the U-MAIL SMTP server.
  697.   if [ -f XXX/usr/lib/umail/umail ]
  698.   then
  699.           echo -n "umail "
  700.           /usr/lib/umail/umail -d7 -bd </dev/null >/dev/null 2>&1 &
  701.   fi
  702.  
  703.   # Start the various INET servers.
  704.   for server in ${IN_SERV}
  705.   do
  706.           if [ -f ${NET}/${server} ]
  707.           then
  708.                   echo -n "${server} "
  709.                   ${NET}/${server}
  710.           fi
  711.   done
  712.  
  713.   # Start the various SUN RPC servers.
  714.   if [ -f ${NET}/rpc.portmap ]
  715.   then
  716.           if [ -f ${NET}/rpc.ugidd ]
  717.           then
  718.                   echo -n "ugidd "
  719.                   ${NET}/rpc.ugidd -d
  720.           fi
  721.           if [ -f ${NET}/rpc.mountd ]
  722.           then
  723.                   echo -n "mountd "
  724.                   ${NET}/rpc.mountd
  725.           fi
  726.           if [ -f ${NET}/rpc.nfsd ]
  727.           then
  728.                   echo -n "nfsd "
  729.                   ${NET}/rpc.nfsd
  730.           fi
  731.  
  732.           # Fire up the PC-NFS daemon(s).
  733.           if [ -f ${NET}/rpc.pcnfsd ]
  734.           then
  735.                   echo -n "pcnfsd "
  736.                   ${NET}/rpc.pcnfsd ${LPSPOOL}
  737.           fi
  738.           if [ -f ${NET}/rpc.bwnfsd ]
  739.           then
  740.                   echo -n "bwnfsd "
  741.                   ${NET}/rpc.bwnfsd ${LPSPOOL}
  742.           fi
  743.  
  744.   fi
  745.   echo network daemons started.
  746.   # Done!
  747.  
  748.  
  749.   10.3.  Name Resolution.
  750.  
  751.   Name Resolution is the process of converting a hostname in the
  752.   familiar dotted notation (e.g. tsx-11.mit.edu) into an IP address
  753.   which the network software understands. There are two principal means
  754.   of achieving this in a typical installation, one simple, and one more
  755.   complex.
  756.  
  757.  
  758.   10.3.1.  /etc/hosts
  759.  
  760.   /etc/hosts contains a list of ip addresses and the hostnames they map
  761.   to. In this way, you can refer to other machines on the network by
  762.   name, as well as their ip address. Using a nameserver (see section
  763.   `named') allows you to do the same name->ip address translation
  764.   automatically. (Running named allows you to run your own nameserver on
  765.   your linux machine).  This file needs to contain at least an entry for
  766.   127.0.0.1 with the name localhost. If you're not only using loopback,
  767.   you need to add an entry for your ip address, with your full hostname
  768.   (such as loomer.vpizza.com). You may also wish to include entries for
  769.   your gateways and network addresses.
  770.  
  771.   For example, if loomer.vpizza.com has the ip address 128.253.154.32,
  772.   the /etc/hosts file would contain:
  773.  
  774.  
  775.  
  776.        # /etc/hosts
  777.        # List of hostnames and their ip addresses
  778.        127.0.0.1               localhost
  779.        128.253.154.32          loomer.vpizza.com loomer
  780.        # end of hosts
  781.  
  782.  
  783.  
  784.  
  785.   Once again you will need to edit this file to suit your own needs. If
  786.   you're only using loopback, the only line in /etc/hosts should be for
  787.   127.0.0.1, with both localhost and your hostname after it.
  788.  
  789.   Note that in the second line, above, there are two names for
  790.   128.253.154.32: loomer.vpizza.com and just loomer.  The first name is
  791.   the full hostname of the system, called the "Fully Qualified Domain
  792.   Name", and the second is an alias for it. The second allows you to
  793.   type only rlogin loomer instead of having to type the entire hostname.
  794.   You should ensure that you put the Fully Qualified Domain Name in the
  795.   line before the alias name.
  796.  
  797.  
  798.   10.3.2.  named - do I need thee ?
  799.  
  800.   `I dub thee ..'
  801.  
  802.   named is the nameserver daemon for many unix-like operating systems.
  803.   It allows your machine to serve the name lookup requests, not only for
  804.   itself, but also for other machines on the network, that is, if
  805.   another machine wants to find the address for `goober.norelco.com',
  806.   and you have this machines address in your named database, then you
  807.   can service the request and tell other machines what `goobers' address
  808.   is.
  809.  
  810.   Under older implementations of Linux tcp/ip, to create aliases for
  811.   machine names, (even for your own machine), you had to run named on
  812.   your Linux machine to do the hostname to IP address conversion. One
  813.   problem with this is that named is comparitively difficult to set up
  814.   properly, and maintain.  To solve this problem, a program called
  815.   hostcvt.build was made available on Linux systems to translate your
  816.   /etc/hosts file into the many files that make up named database files.
  817.   However even with this problem overcome, named still uses CPU overhead
  818.   and causes network traffic.
  819.  
  820.   The bottom line is this: You do not need to run named on your Linux
  821.   system. The SLS instructions will probably tell you to run
  822.   hostcvt.build to setup named. This is simply unnecessary unless you
  823.   want to make your Linux system function as a nameserver for other
  824.   machines, in which case you probably should learn some more about
  825.   named anyway. When looking up hostnames, your linux machine will first
  826.   check the /etc/hosts file, and then ask the nameserver out on the net.
  827.  
  828.   The only reason you may want to run named would be if:
  829.  
  830.  
  831.   o  You're setting up a network of machines, and need a nameserver for
  832.      one of them, and don't have a nameserver out on the net somewhere.
  833.  
  834.   o  Your network administrators want you to run your Linux system as a
  835.      nameserver for some reason.
  836.  
  837.   o  You have a slow slip connection, and want to run a small cache-only
  838.      nameserver on your Linux machine so that you don't have to go out
  839.      on the serial line for every name lookup that occurs. If you're
  840.      only going to be connecting to a small number of hosts on the net,
  841.      and you know what their addresses are, then you can put them in
  842.      your hosts file and not need to query a nameserver at all.
  843.      Generally namelookup isn't that slow and should work fine over a
  844.      slip link anyway.
  845.  
  846.   o  You want to run a nameserver for fun and excitement.
  847.  
  848.   In general, you do NOT need to run named: this means that you can
  849.   comment it out from your rc.inet2 file, and you don't have to run
  850.   hostcvt.build. If you want to alias machine names, for example, if you
  851.   want to refer to loomer.vpizza.com as just loomer, then you can add as
  852.   alias in /etc/hosts instead. There is no reason to run named unless
  853.   you have a specific requirement to do so. If you have access to a
  854.   nameserver, (and your network administrators will tell you its
  855.   address), and most networks do, then don't bother running named.
  856.  
  857.   If you're only using loopback, you can run named and set your
  858.   nameserver address to 127.0.0.1, but since you are the only machine
  859.   you can talk to, this would be quite bizzarre, as you'd never need to
  860.   call it.
  861.  
  862.  
  863.   10.3.3.  /etc/networks
  864.  
  865.   The /etc/networks file lists the names and addresses of your own, and
  866.   other, networks. It is used by the route command, and allows you to
  867.   specify a network by name, should you so desire.
  868.  
  869.   Every network you wish to add a route to using the route command
  870.   should have an entry in the /etc/networks file, unless you also
  871.   specify the -net argument in the route command line.
  872.  
  873.   Its format is simliar to that of /etc/hosts file above, and an example
  874.   file might look like:
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.   #
  882.   # /etc/networks: list all networks that you wish to add route commands
  883.   #                for in here
  884.   #
  885.   default         0.0.0.0         # default route    - recommended
  886.   loopnet         127.0.0.0       # loopback network - recommended
  887.   mynet           128.253.154.0   # Example network CHANGE to YOURS
  888.   #
  889.   # end of networks
  890.  
  891.  
  892.  
  893.  
  894.  
  895.   10.3.4.  /etc/host.conf
  896.  
  897.   The system has some library functions called the resolver library.
  898.   This file specifies how your system will lookup host names. It should
  899.   contain at least the following two lines:
  900.  
  901.  
  902.  
  903.        order hosts,bind
  904.        multi on
  905.  
  906.  
  907.  
  908.  
  909.   These two lines tell the resolve libraries to first check the
  910.   /etc/hosts file, and then to ask the nameserver (if one is present).
  911.   The multi entry allows you to have multiple IP addresses for a given
  912.   machine name in /etc/hosts.
  913.  
  914.   This file comes from the implementation of the resolv+ bind library
  915.   for Linux. You can find further documentation in the resolv+(8) man
  916.   page if you have it. If you don't, it can be obtained from:
  917.  
  918.   sunsite.doc.ic.ac.uk
  919.  
  920.  
  921.        /computing/comms/tcpip/nameserver/resolv+/resolv+2.1.1.tar.Z
  922.  
  923.  
  924.  
  925.  
  926.   This file contains the resolv+.8 man page for the resolver library.
  927.  
  928.  
  929.   10.3.5.  /etc/resolv.conf
  930.  
  931.   This file actually configures the system name resolver, and contains
  932.   two types of entries: The addresses of your nameservers (if any), and
  933.   the name of your domain, if you have one. If you're running your own
  934.   nameserver (i.e running named on your Linux machine), then the address
  935.   of your nameserver is 127.0.0.1, the loopback address.
  936.  
  937.   Your domain name is your fully qualified hostname (if you're a
  938.   registered machine on the Internet, for example), with the hostname
  939.   component removed.  That is, if your full hostname is
  940.   loomer.vpizza.com, then your domain name is vpizza.com, without the
  941.   hostname loomer.
  942.  
  943.   For example, if you machine is goober.norelco.com, and has a
  944.   nameserver at the address 128.253.154.5, then your /etc/resolv.conf
  945.   file would look like:
  946.  
  947.        domain norelco.com
  948.        nameserver 127.253.154.5
  949.  
  950.  
  951.  
  952.  
  953.   You can specify more than one nameserver. Each one must have a
  954.   nameserver entry in the resolv.conf file.
  955.  
  956.   Remember, if you're running on loopback, you don't need a nameserver.
  957.  
  958.  
  959.   10.3.6.  Configuring your Hostname - /etc/HOSTNAME
  960.  
  961.   After you have configured everything else, there is one small task
  962.   that remains, you need to configure your own machine with a name. This
  963.   is so that application programs like sendmail can know who you are to
  964.   accept mail, and so that your machine can identify itself to other
  965.   machines that it might be connected to.
  966.  
  967.   There are two programs that are used to configure this sort of
  968.   information, and they are commonly misused. They are hostname and
  969.   domainname.
  970.  
  971.   If you are using a release of net-tools earlier than 1.1.38 then you
  972.   can include a command in your /etc/rc file that looks like this:
  973.  
  974.  
  975.  
  976.        /bin/hostname -S
  977.  
  978.  
  979.  
  980.  
  981.   and this will cause the hostname command to read a file called
  982.   /etc/HOSTNAME which it expects will contain a "Fully Qualified Domain
  983.   Name", that is, your machines hostname including the domainname. It
  984.   will split the F.Q.D.N. into its DNS hostname and domainname
  985.   components and set them appropriately for you.
  986.  
  987.   For example, the machine above would have the file /etc/HOSTNAME:
  988.  
  989.  
  990.  
  991.        goober.norelco.com
  992.  
  993.  
  994.  
  995.  
  996.   If you are using the hostname that came with net-tools-1.1.38 or
  997.   later, then you would add a command at the end of your
  998.   /etc/rc.d/rc.inet1 file like:
  999.  
  1000.  
  1001.  
  1002.        /bin/hostname goober.norelco.com
  1003.  
  1004.  
  1005.  
  1006.  
  1007.   or if you have upgraded from a previous release, you could add:
  1008.  
  1009.  
  1010.  
  1011.        /bin/hostname -F /etc/HOSTNAME
  1012.  
  1013.   and it would behave in the same way as for the earlier version.
  1014.  
  1015.   The /bin/domainname command is for setting the N.I.S.  domain name NOT
  1016.   the D.N.S. domain name. You do not need to set this unless you are
  1017.   running NIS, which is briefly described later.
  1018.  
  1019.  
  1020.   10.4.  Other files.
  1021.  
  1022.   There are of course many other files in the /etc directory which you
  1023.   may need to dabble with later on. Instead of going into them here, I'm
  1024.   going to provide the bare minimum to get you on the net. More
  1025.   information is available in Olaf's Network Administration Guide. It
  1026.   picks up where this HOWTO ends, and some more information will be
  1027.   provided in later versions of this document.
  1028.  
  1029.   Once you have all of the files set up, and everthing in the right
  1030.   place, you should be able to reboot you new kernel, and net away to
  1031.   your hearts content.  However I strongly suggest that you keep a
  1032.   bootable copy of your old kernel and possibly even a `recovery disk',
  1033.   in case something goes wrong, so that you can get back in and fix it.
  1034.   You might try HJLu's `single disk boot disk', or `disk1' from an SLS
  1035.   distribution.
  1036.  
  1037.  
  1038.   11.  Advanced Configurations.
  1039.  
  1040.   The configurations above have described how a typical Linux
  1041.   workstation might be configured for normal end-user operation. Some of
  1042.   you will have other requirements which will require slightly more
  1043.   advanced configurations. What follows are examples of some the more
  1044.   common of these.
  1045.  
  1046.  
  1047.   11.1.  PPP - Point to Point Protocol.
  1048.  
  1049.   The Point to Point Protocol is a modern and efficient protocol for
  1050.   conveying multiple protocols, tcp/ip for one, across serial links,
  1051.   that a lot of people use in place of slip. It offers enhanced
  1052.   functionality, error detection and security options. It corrects a
  1053.   number of deficiencies that are found in slip, and is suitable for
  1054.   both asynchronous links and synchronous links alike.
  1055.  
  1056.   An important feature of PPP operation is dynamic address allocation,
  1057.   and this feature will almost certainly be exploited by your PPP
  1058.   server. This feature allows a PPP client, with a specially formatted
  1059.   frame, to request its address from the server. In this way
  1060.   configuration is somewhat less messy than with slip, since this
  1061.   ability to retrieve your address must occur outside of the protocol.
  1062.  
  1063.   The authors of the Linux port are Michael Callahan,
  1064.   <callahan@maths.ox.ac.uk> and  Al Longyear, <longyear@netcom.com>.
  1065.   Most of this information has come from the documentation that
  1066.   accompanies the PPP software. The documentation is quite complete, and
  1067.   will tell you much more than I present here.
  1068.  
  1069.   The Linux PPP code has come out of Alpha testing and is now available
  1070.   as a public release. The 1.0.0 Linux PPP code is based on Paul
  1071.   Mackerras's free PPP for BSD-derivative operating systems. The 1.0.0
  1072.   release is based on version 2.1.1 of the free PPP code.
  1073.  
  1074.   The PPP code comes in two parts. The first is a kernel module which
  1075.   handles the assembly and disassembly of the frames, and the second is
  1076.   a set of protocols called LCP, IPCP, UPAP and CHAP, for negotiating
  1077.   link options, bringing the link into a functioning state and for
  1078.   authentication.
  1079.   11.1.1.  Why would I use PPP in place of SLIP ?
  1080.  
  1081.   You would use PPP in place of SLIP for a few reasons. The most common
  1082.   are:
  1083.  
  1084.  
  1085.      Your Internet Provider supports only PPP
  1086.         The most obvious reason you would use PPP in favour of SLIP is
  1087.         when your Internet Provider supports PPP and not SLIP. Ok, I
  1088.         said it was obvious.
  1089.  
  1090.      You have a normally noisy serial line
  1091.         PPP provides a frame check sequence for each and every frame
  1092.         transmitted, SLIP does not. If you have a noisy serial line, and
  1093.         you are using SLIP, your error correction will be performed end
  1094.         to end, that is between your machine and the destination
  1095.         machine, whereas with PPP the error detection occurs locally,
  1096.         between your machine and the PPP server. This makes for faster
  1097.         recovery from errors.
  1098.  
  1099.      You need to make use of some other feature PPP offers.
  1100.         PPP provides a number of features that SLIP does not. You might
  1101.         for example want to carry not only IP, but also DECNET, or
  1102.         AppleTalk frames over your serial link. PPP will allow you to do
  1103.         this.
  1104.  
  1105.  
  1106.   11.1.2.  Where to obtain the PPP software.
  1107.  
  1108.   The ppp software is available from:
  1109.  
  1110.   sunsite.unc.edu
  1111.  
  1112.  
  1113.        /pub/Linux/system/Networking/serial/ppp-2.1.2a.tar.gz
  1114.  
  1115.  
  1116.  
  1117.  
  1118.   This file contains the kernel source, and the pppd source and binary.
  1119.   Version 1.0.0 is meant for use with kernels 1.0.x and 1.1.x. No
  1120.   support is currently available for Fred's Net-2E kernel.
  1121.  
  1122.  
  1123.   11.1.3.  Installing the PPP software.
  1124.  
  1125.   Installation of the PPP software is fairly straightforward.
  1126.  
  1127.  
  1128.   11.1.3.1.  The kernel driver.
  1129.  
  1130.   Some support for ppp has been built into the kernel for some time.
  1131.   Configuring the kernel is fairly easy, the following should work ok:
  1132.  
  1133.  
  1134.  
  1135.        # cd /usr/src
  1136.        # gzip -dc ppp-2.1.2a.tar.gz | tar xvf -
  1137.        # cp /usr/src/ppp-2.1.2a/linux/ppp.c /usr/src/linux/drivers/net
  1138.        # cp /usr/src/ppp-2.1.2a/pppd/ppp.h /usr/src/linux/include/linux
  1139.  
  1140.  
  1141.  
  1142.  
  1143.   You will then need to uncomment the CONFIG_PPP line in
  1144.   /usr/src/linux/config.in. If you are running a version of the kernel
  1145.   that is 1.1.4 or higher, then you will also need to comment out or
  1146.   delete the macro definition of NET02D in the file
  1147.   /usr/src/linux/drivers/net/ppp.c. If you are running an even more
  1148.   recent version then you make not to make any changes at all.
  1149.  
  1150.   You can then do a make config, select PPP support, and follow with a
  1151.   make dep;make.
  1152.  
  1153.   When you reboot with the new kernel you should see messages at boot
  1154.   time that look something like these:
  1155.  
  1156.  
  1157.  
  1158.        PPP: version 2.1.1 (4 channels)
  1159.        TCP compression code copyright 1989 Regents of the University of California
  1160.        PPP line discipline registered.
  1161.  
  1162.  
  1163.  
  1164.  
  1165.   Now, try looking at the contents of /proc/net/dev. It should look
  1166.   something like this:
  1167.  
  1168.  
  1169.  
  1170.          Inter-|   Receive                  |  Transmit
  1171.           face |packets errs drop fifo frame|packets errs drop fifo colls carrier
  1172.              lo:      0    0    0    0    0        0    0    0    0     0    0
  1173.            ppp0:      0    0    0    0    0        0    0    0    0     0    0
  1174.            ppp1:      0    0    0    0    0        0    0    0    0     0    0
  1175.            ppp2:      0    0    0    0    0        0    0    0    0     0    0
  1176.            ppp3:      0    0    0    0    0        0    0    0    0     0    0
  1177.  
  1178.  
  1179.  
  1180.  
  1181.   This indicates that the kernel driver is installed correctly.
  1182.  
  1183.  
  1184.   11.1.3.2.  pppd
  1185.  
  1186.   If you want to recompile pppd, type make in the pppd subdirectory of
  1187.   the installation.  There will be some warnings when compiling lcp.c,
  1188.   upap.c and chap.c but these are OK.
  1189.  
  1190.   If you want to recompile chat, consult README.linux in the chat
  1191.   directory.
  1192.  
  1193.   To install, type make install in the chat and pppd directories.   This
  1194.   will put chat and pppd binaries in /usr/etc and the pppd.8 manual page
  1195.   in /usr/man/man8.
  1196.  
  1197.   pppd needs to be run as root. You can either make it suid root or just
  1198.   use it when you are root. make install will try to install it suid
  1199.   root, so if you are root when you try to install it, it should work
  1200.   ok.
  1201.  
  1202.  
  1203.   11.1.4.  Configuring and using the PPP software.
  1204.  
  1205.   Like slip, you can configure the PPP software as either a client or a
  1206.   server.  The chat performs a similar function to the dip program in
  1207.   that it is used to automate the dialling and login procedure to the
  1208.   remote machine, unlike dip though, it does not perform the ioctl to
  1209.   convert the serial line into a PPP line. This is performed by the pppd
  1210.   program. pppd can act as either the client or the server. When used as
  1211.   a client, it normally invokes the chat program to perform the
  1212.   connection and login, and then it takes over by performing the ioctl
  1213.   to change the line discipline to ppp and then steps out of the way to
  1214.   let you operate.
  1215.  
  1216.   Please refer to the pppd and chat man pages for more information.
  1217.   Please also refer to the README file that comes with the ppp software,
  1218.   as its description of the operation of these utilities is much more
  1219.   complete than I have described here.
  1220.  
  1221.  
  1222.   11.1.4.1.  Configuring a PPP client by dial-up modem.
  1223.  
  1224.   This is perhaps what most of you will want to do, so it appears first.
  1225.   You would use this configuration when you have a network provider who
  1226.   supports ppp by dialup modem. When you want to establish your
  1227.   connection you simply have to invoke the pppd program with appropriate
  1228.   arguments.
  1229.  
  1230.   The following example might look a little confusing at first, but it
  1231.   is easier to understand if you can see that all it is doing is taking
  1232.   a command line for the chat program as its first argument and then
  1233.   others for itself later.
  1234.  
  1235.  
  1236.  
  1237.        pppd connect 'chat -v "" ATDT5551212 CONNECT "" ogin: ppp word: password'\
  1238.              /dev/cua1 38400 debug crtscts modem defaultroute 192.1.1.17:
  1239.  
  1240.  
  1241.  
  1242.  
  1243.   What this says is:
  1244.  
  1245.  
  1246.   o  Invoke the chat program with the command line:
  1247.  
  1248.  
  1249.        chat -v "" ATDT5551212 CONNECT "" ogin: ppp word: password
  1250.  
  1251.  
  1252.  
  1253.  
  1254.   Which says: Dial 5551212, wait for the `CONNECT' string, transmit a
  1255.   carriage return, wait for the string `ogin:', transmit the string
  1256.   `ppp', wait for the string `word:', transmit the string `password',
  1257.   and quit.
  1258.  
  1259.   o  Use serial device /dev/cua1
  1260.  
  1261.   o  Set its speed to 38400 bps.
  1262.  
  1263.   o  debug means log status messages to syslog
  1264.  
  1265.   o  crtscts means use hardware handshaking to the modem - recommended.
  1266.  
  1267.   o  modem means that pppd will attempt to hang up the call before and
  1268.      after making the call.
  1269.  
  1270.   o  defaultroute instructs pppd to add a routing entry that makes this
  1271.      the default route. In most cases this will be what you want.
  1272.  
  1273.   o  192.1.1.17: says to set the ppp interfaces address to 192.1.1.17.
  1274.      This argument normally looks like x.x.x.x:y.y.y.y, where x.x.x.x is
  1275.      your ip address, and y.y.y.y is the ip address of the server. If
  1276.      you leave off the server's address, pppd will ask for it, and
  1277.      x.x.x.x will be set to your machines ip address.
  1278.  
  1279.   Please refer to the pppd and chat man pages for more information.
  1280.   Please also refer to the README file that comes with the ppp software,
  1281.   as its description of the above is much more complete than I have
  1282.   described here.
  1283.  
  1284.  
  1285.   11.1.4.2.  Configuring a PPP client via a leased line.
  1286.  
  1287.   Configuring a PPP client via a leased line is almost as
  1288.   straightforward as for configuring slip with slattach. You will still
  1289.   use the pppd program, but since you won't need to establish the modem
  1290.   link the arguments to the chat program can be much simpler.
  1291.  
  1292.   The example I'm presenting here assumes that the ppp server doesn't
  1293.   require any special login procedure. I do this because every login
  1294.   procedure will be different, and if you are simply running a local
  1295.   connection then it is possible that you might have it set up this way.
  1296.  
  1297.  
  1298.  
  1299.        pppd connect 'echo connecting...' defaultroute noipdefault debug \
  1300.              kdebug 2 /dev/cua0 9600
  1301.  
  1302.  
  1303.  
  1304.  
  1305.   This will echo a message to your screen, and set your default route
  1306.   via the ppp interface. The noipdefault argument instructs the pppd
  1307.   program to request the address to use for this device from the server.
  1308.   Debug messages will go to syslog. The kdebug 2 argument causes the
  1309.   debug messages to be set to level 2, this will give you slightly more
  1310.   information on what is going on. It will use /dev/cua0 at 9600 bps.
  1311.  
  1312.   If your ppp server does require some sort of login procedure, you can
  1313.   easily use the chat program as in the example for the dialup server to
  1314.   perform that function for you.
  1315.  
  1316.   Please refer to the pppd and chat man pages for more information.
  1317.   Please also refer to the README file that comes with the ppp software,
  1318.   as its description of the above is much more complete than I have
  1319.   described here.
  1320.  
  1321.  
  1322.   11.1.4.3.  Configuring a PPP server.
  1323.  
  1324.   Configuring a PPP server is similar to establishing a slip server.
  1325.   You can create a special `ppp' account, which uses an executable
  1326.   script as its login shell. The /etc/passwd entry might look like:
  1327.  
  1328.  
  1329.  
  1330.        ppp:EncPasswd:102:50:PPP client login:/tmp:/etc/ppp/ppplogin
  1331.  
  1332.  
  1333.  
  1334.  
  1335.   and the /etc/ppp/ppplogin script might look like:
  1336.  
  1337.  
  1338.  
  1339.        #!/bin/sh
  1340.        exec /usr/etc/pppd passive :192.1.2.23
  1341.  
  1342.  
  1343.   The address that you provide will be the address that the calling
  1344.   machine will be assigned.
  1345.  
  1346.   Naturally, if you want multiple users to have simultaneous access you
  1347.   would have to create a number of startup scripts and individual
  1348.   accounts for each to use, as you can only put one ip address in each
  1349.   script.
  1350.  
  1351.  
  1352.   11.1.5.  Where to obtain more information on PPP, or report bugs.
  1353.  
  1354.   Most discussion on PPP for Linux takes place on the PPP mailing list.
  1355.  
  1356.   To join the Linux PPP channel on the mail list server, send mail to:
  1357.  
  1358.  
  1359.  
  1360.        linux-activists@niksula.hut.fi
  1361.  
  1362.        with the line:
  1363.  
  1364.        X-Mn-Admin: join PPP
  1365.  
  1366.        at the top of the message body (not the subject line).
  1367.  
  1368.  
  1369.  
  1370.  
  1371.   Please remember that when you are reporting bugs or problems you
  1372.   should include as much information relevant to the problem as you can
  1373.   to assist those that will help you understand your problem.
  1374.  
  1375.   You might also like to check out:
  1376.  
  1377.   RFCS 1548, 1331, 1332, 1333, and 1334. These are the definitive
  1378.   documents for PPP.
  1379.  
  1380.   W. Richard Stevens also describes PPP in his book `TCP/IP Illustrated
  1381.   Volume 1', (Addison-Wessley, 1994, ISBN 0-201-63346-9).
  1382.  
  1383.  
  1384.   11.2.  Configuring Linux as a Slip Server.
  1385.  
  1386.   If you have a machine that is perhaps network connected, that you'd
  1387.   like other people be able to dial into, and provide network services,
  1388.   then you will need to configure your machine as a server. If you want
  1389.   to use slip as the serial line protocol, then currently you have two
  1390.   options as to how to configure your Linux machine as a slip server. I
  1391.   will present a summary of both.
  1392.  
  1393.  
  1394.   11.2.1.  Slip Server using sliplogin
  1395.  
  1396.   sliplogin is a program that you can use in place of the normal login
  1397.   shell for slip users that converts the terminal line into a slip line.
  1398.   The caller will login as per the standard login process, entering
  1399.   their username and password, but instead of being presented with a
  1400.   shell after their login, sliplogin is executed which searches its
  1401.   configuration file (/etc/slip.hosts) for an entry with a login name
  1402.   that matches that of the caller. If it locates one, it configures the
  1403.   line as an 8bit clean line, and uses an ioctl call to convert the line
  1404.   discipline to slip. When this process is complete, the last stage of
  1405.   configuration takes place, where sliplogin invokes a shell script
  1406.   which configures the slip interface with the relevant ip address,
  1407.   netmask and sets appropriate routing in place. This script is usually
  1408.   called /etc/slip.login, but in a similar manner to getty, if you have
  1409.   certain callers that require special initialisation, then you can
  1410.   create configuration scripts called /etc/slip.login.loginname that
  1411.   will be run instead of the default.
  1412.  
  1413.  
  1414.   11.2.1.1.  Where to get sliplogin
  1415.  
  1416.   sliplogin can be obtained from:
  1417.  
  1418.   sunsite.unc.edu
  1419.  
  1420.  
  1421.        /pub/Linux/system/Network/serial/sliplogin.tar.gz
  1422.  
  1423.  
  1424.  
  1425.  
  1426.   The tar file contains both source, precompiled binaries and a man
  1427.   page.  To install the binaries into your /sbin directory, and the man
  1428.   page into section 8, do the following:
  1429.  
  1430.  
  1431.  
  1432.        # cd /usr/src
  1433.        # gzip -dc .../sliplogin.tar.gz | tar xvf -
  1434.        # cd src
  1435.        # make install
  1436.  
  1437.  
  1438.  
  1439.  
  1440.   If you want to recompile the binaries before installation, add a make
  1441.   clean before the make install. If you want to install the binaries
  1442.   somewhere else, you will need to edit the Makefile install rule.
  1443.  
  1444.  
  1445.   11.2.1.2.  Configuring /etc/passwd for Slip hosts.
  1446.  
  1447.   You need to create some special logins for Slip callers in your
  1448.   /etc/passwd file. A convention commonly followed is to use the
  1449.   hostname of the calling host with a capital `S' prefixing it. So, for
  1450.   example, if the calling host is called radio then you would create a
  1451.   /etc/passwd entry that looked like:
  1452.  
  1453.  
  1454.  
  1455.        Sradio:FvKurok73:1427:1:radio slip login:/tmp:/sbin/sliplogin
  1456.  
  1457.  
  1458.  
  1459.  
  1460.   Note: the caller doesn't need any special home directory, as they will
  1461.   not be presented with a shell from this machine, so /tmp is a good
  1462.   choice.  Also note that sliplogin is used in place of the normal login
  1463.   shell.
  1464.  
  1465.  
  1466.   11.2.1.3.  Configuring /etc/slip.hosts
  1467.  
  1468.   The /etc/slip.hosts file is the file that sliplogin searches for
  1469.   entries matching the login name to obtain configuration details for
  1470.   this caller. It is this file where you specify the ip address and
  1471.   netmask that will be assigned to the caller, and configured for their
  1472.   use. A sample entry for host `radio' might look like:
  1473.  
  1474.  
  1475.        Sradio    `hostname`    radio    <netmask>    <opt1>    <opt2>
  1476.  
  1477.  
  1478.  
  1479.  
  1480.   The /etc/slip.hosts file entries are:
  1481.  
  1482.  
  1483.   1. the login name of the caller.
  1484.  
  1485.   2. ip address of the server machine, ie this machine.
  1486.  
  1487.   3. ip address that the caller will be assigned.
  1488.  
  1489.   4. the netmask assigned to the calling machine in hexadecimal notation
  1490.      eg 0xffffff00 for a Class C network mask.
  1491.  
  1492.   5. optional parameters to enable/disable compression and other
  1493.      features.
  1494.  
  1495.   Note: You can use either hostnames or IP addresses in dotted decimal
  1496.   notation for fields 2 and 3. If you use hostnames then those hosts
  1497.   must be resolvable, that is, your machine must be able to locate an ip
  1498.   address for those hostnames, otherwise the script will fail when it is
  1499.   called. You can test this by trying trying to telnet to the hostname,
  1500.   if you get the `Trying nnn.nnn.nnn...'  message then your machine has
  1501.   been able to find an ip address for that name.  If you get the message
  1502.   `Unknown host', then it has not. If not, either use ip addresses in
  1503.   dotted decimal notation, or fix up your name resolver configuration.
  1504.  
  1505.   The most commonly used optional paramaters for the opt1 and opt2
  1506.   fields are:
  1507.  
  1508.  
  1509.      normal
  1510.         to enable normal uncompressed slip.
  1511.  
  1512. ---End of part 2/3---
  1513.  
  1514.  
  1515.